package com.skymxc.wandroidtodo.page.base;

import android.app.Application;

import com.skymxc.wandroidtodo.mvp.IModel;
import com.skymxc.wandroidtodo.mvp.IPresenter;
import com.skymxc.wandroidtodo.mvp.IView;

import io.reactivex.disposables.CompositeDisposable;

/**
 * <p>
 *
 * </p>
 *
 * @author 孟祥超
 * <p>
 * date: 2021/12/1  7:08 上午
 */
public abstract class BasePresenter<V extends IView> implements IPresenter<V> {

    protected Application application;

    public BasePresenter(Application application) {
        this.application = application;
    }

    protected CompositeDisposable compositeDisposable = new CompositeDisposable();
    protected V view;

    @Override
    public void attachView(V view) {
        this.view  =view;
    }

    @Override
    public void detachView(V view) {
        compositeDisposable.dispose();
    }
}
